package com.example.uploadfilestoserver;

import com.mreko.dashupload.DashServer;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;

public class AsyTask extends Activity {

	private Button button;
	private ProgressBar progressBar;
	private TextView textView;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		button = (Button) findViewById(R.id.button03);
		progressBar = (ProgressBar) findViewById(R.id.progressBar02);
		textView = (TextView) findViewById(R.id.textView01);

		button.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				new Thread() {
					public void run() {
						String[] srcPaths = { "/mnt/sdcard/kate/renren.mp4",
								"/mnt/sdcard/kate/renren1.mp4",
								"/mnt/sdcard/kate/renren2.mp4",
								"/mnt/sdcard/kate/renren3.mp4",
								"/mnt/sdcard/kate/renren4.mp4",
								"/mnt/sdcard/kate/renren5.mp4",
								"/mnt/sdcard/kate/renren6.mp4",
								"/mnt/sdcard/kate/renren7.mp4"};
						DashServer.getInstance().uploadFile("test3", 8,
								srcPaths, textView, progressBar);
					}
				}.start();
			}
		});
	}
}
